gtkimmodule: make match_backend() query
authorPeter Bloomfield <PeterBloomfield@bellsouth.net>
Mon, 12 Mar 2018 21:46:57 +0000 (17:46 -0400)
committerPeter Bloomfield <PeterBloomfield@bellsouth.net>
Mon, 12 Mar 2018 21:46:57 +0000 (17:46 -0400)
…the wayland registry.

Wnen _gtk_im_module_get_default_context_id calls
match_backend (context_id) and the default GdkDisplay
is wayland, match_backend() should return TRUE only if
gdk_wayland_display_query_registry (display, "gtk_text_input_manager")
returns TRUE.

gtk/gtkimmodule.c

index 0c9955342331fa52198546e3821aacfd88ecbf9a..bdf956dd631948a2a23cdace3d14dea83500bd05 100644 (file)
@@ -119,7 +119,13 @@ match_backend (const char *context_id)
 {
 #ifdef GDK_WINDOWING_WAYLAND
   if (g_strcmp0 (context_id, "wayland") == 0)
-    return GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default ());
+    {
+      GdkDisplay *display = gdk_display_get_default ();
+
+      return GDK_IS_WAYLAND_DISPLAY (display) &&
+             gdk_wayland_display_query_registry (display,
+                                                 "gtk_text_input_manager");
+    }
 #endif
 
 #ifdef GDK_WINDOWING_BROADWAY